package com.ruoyi.web.controller.tai;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.IAlertEventTypeService;
import com.ruoyi.service.IEventTypeService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * 这段代码具有神奇的bug他会很自然导致 @Resource注入不了，但如果你去掉@PreAuthorize 它就正常了，它仿佛具有自由的意志
 * */
@RestController
@RequestMapping("/test/event/type")
public class TestEventController extends BaseController{



    @Resource
    private IAlertEventTypeService alertService;

    @Resource
    private IEventTypeService eventTypeService;

    @PreAuthorize("@ss.hasPermi('event:type:list')")
    @GetMapping("/list")
    private AjaxResult list(){
        return success(eventTypeService.list());
    }

}

